From e7e047fc3fa7ae0fc9909e6dff00810973c1d3c2 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 26 Oct 2017 12:09:44 +0200 Subject: [PATCH] gdk/wayland: Restrict shortcut inhibition to keyboard grabs on toplevels It is unlikely that popup windows will contain anything that requires this (popup menus being more interested in redirecting keyboard focus to themselves). OTOH popup implementations that just grab the keyboard are commonplace enough, it makes sense not to trigger inhibition for these. https://bugzilla.gnome.org/show_bug.cgi?id=789268 --- gdk/wayland/gdkdevice-wayland.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 7babcc0b01..0f2afd0f42 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -756,8 +756,12 @@ gdk_wayland_device_grab (GdkDevice *device, if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) { /* Device is a keyboard */ - gdk_wayland_window_inhibit_shortcuts (window, - gdk_device_get_seat (device)); + if (gdk_window_get_window_type (window) == GDK_WINDOW_TOPLEVEL) + { + gdk_wayland_window_inhibit_shortcuts (window, + gdk_device_get_seat (device)); + } + return GDK_GRAB_SUCCESS; } else @@ -4787,8 +4791,9 @@ gdk_wayland_seat_grab (GdkSeat *seat, evtime, FALSE); - /* Inhibit shortcuts if the seat grab is for the keyboard only */ - if (capabilities == GDK_SEAT_CAPABILITY_KEYBOARD) + /* Inhibit shortcuts on toplevels if the seat grab is for the keyboard only */ + if (capabilities == GDK_SEAT_CAPABILITY_KEYBOARD && + native->window_type == GDK_WINDOW_TOPLEVEL) gdk_wayland_window_inhibit_shortcuts (window, seat); } -- 2.30.2